<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.users.Functionality" %>
<%@ page import="com.scalar.chiptrack.users.User" %>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/dataEntryLots.do" />

<%String chipTracContext = "/" + ConfigManager.getChipTracContext(); %>

<HTML>
<HEAD>
<TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type='text/css' rel='stylesheet'>
<script type="text/javascript">

    function showDataEntryLots()
    {
        var form = document.dataEntryLotsForm;
        form.action = "<%=chipTracContext%>/dataEntryLots.do?action=search";
        form.submit();
    }
    function loadVendors()
    {
        var form = document.dataEntryLotsForm;
        form.action = "<%=chipTracContext%>/dataEntryLots.do?action=searchScreen";
        form.submit();
    }
    function saveDataEntryLots()
    {
        var form = document.dataEntryLotsForm;
        var pa = document.getElementById ( "errors" );
        var j = 0;
        var selected = false;
        while ( true )
        {
            var checkBoxCtrl = form['dataEntryLots[' + (j++) + '].selected'] ;
            
            if ( checkBoxCtrl == null || typeof checkBoxCtrl == 'undefined' )
            {
                break;
            }
            if ( checkBoxCtrl.checked )
            {
                selected = true;
                break;
            }
        }
        if ( !selected )
        {
            pa.innerHTML = "<li>Please select atleast one lot to close</li>";
            return;
        }
        form.action = "<%=chipTracContext%>/dataEntryLots.do?action=save";
        form.submit();
    }
</script>
</HEAD>
<BODY bgColor='#ffffff' leftMargin='0' topMargin='0' marginheight="0" marginwidth="0">
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
    <!-- Side Navigation start -->
    <%@ include file="/jsp/operations/dataentryMenu.jsp" %>
    <!-- end of the side navigations -->
    </td>
    <TD bgcolor="#ffffff">
        <IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8>
    </TD>
    <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
    <TD valign="top" width="100%">
        <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
    <!-- from here your body starts -->
    
<html:form action="/dataEntryLots" name="dataEntryLotsForm" type="com.scalar.chiptrack.operations.dataentry.forms.DataEntryLotsForm">
        <table border="0" width="90%" align=center>
            <TR><TD colspan=6 class="NArialW" align="center">Data Entry Lots</TD></TR>
            <tr><td colspan='6' align="left" class='NArialL'><b>
                <font styleClass="NArialL" align="center" color='FF0000' id="errors">
                    <chiptrack:info styleClass="NArialL"/>
                    <chiptrack:errors styleClass="NArialL"/>
                </font></b>
            </td></tr>
            <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
            <tr>
                <td>
                    <table align="center" border=0 width="70%">
                        <tr>
                            <td valign="top" class="NArialL" >Process:</td>
                            <td valign="top">
                                <nested:select property="psType" styleClass="txfield" onchange="javascript:loadVendors()">
                                    <html:options collection="psTypes" property="value" labelProperty="label"/>
                                </nested:select>
                            </td>
                            <td>&nbsp;</td>
                            <td valign="top" class="NArialL" >Vendor:</td>
                            <td valign="top">
                                <nested:select property="vendorName" styleClass="txfield">
                                    <html:options collection="vendors" property="label" labelProperty="label"/>
                                </nested:select>
                            </td>
                        </tr>
                        <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td></tr>
                        <tr><td colspan=5 align="center">
                            <chiptrack:restrictedLink href="javascript:showDataEntryLots()" functionality='<%=Functionality.DATA_ENTRY_LOTS %>' action='<%=User.USER_ACTION_VIEW%>' styleClass="leftsection" onmouseover="window.status='Click to search for DataEntry Lots';return true" onmouseout="window.status='';return true">
                            <img src="<%=chipTracContext%>/jsp/includes/images/search.gif" border="0" width="53" height="17" title="Click here to Search for DataEntry Lots">
                            </chiptrack:restrictedLink>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:document.dataEntryLotsForm.reset();">
                            <img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17">
                            </a>
                            </td>
                        </tr>
                    </table>
                </td>
	        </tr>

        <logic:equal name="showDataEntryLots" value="true">
            <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
            <tr>
                <td colspan=6>
                    <table border="0" width="100%" bordercolor="#FFFFFF" align=right>
                    <nested:size id="dataEntryLotsSize" property="dataEntryLots"/>
                    <logic:equal value="0" name="dataEntryLotsSize">
                        <tr>
                            <td width="25%" colspan="6" bgcolor='' class="NArialL"><font color="red"><li>No DataEntry Lots available for the given search criteria.</li></font></td>
                        </tr>
                    </logic:equal>
                <logic:notEqual value="0" name="dataEntryLotsSize">
                        <tr bgcolor="#993333" class="NArialL">
                            <td width="5%" align="center"><font color="#FFFFFF">Close Lot</font></td>
                            <td width="20%" align="center"><font color="#FFFFFF">Part Number</font></td>
                            <td width="10%" align="center"><font color="#FFFFFF">Lot Number</font></td>
                            <td width="10%" align="center"><font color="#FFFFFF">Fab Lot Number</font></td>
                            <td width="10%" align="center"><font color="#FFFFFF">Vendor</font></td>
                            <td width="10%" align="center"><font color="#FFFFFF">Process</font></td>
                            <td width="10%" align="center"><font color="#FFFFFF">Date In</font></td>
                            <td width="5%" align="center"><font color="#FFFFFF">Qty In</font></td>
                        </tr>
                    <nested:iterate id="dataEntryLots" property="dataEntryLots" indexId="idx">
                        <tr bgcolor='<%=idx.intValue()%2 == 0 ? "#DEE1E2" : "#FFFFEE"%>' class="NArialL">
                            <td><nested:checkbox  property="selected" value="on"/> </td>
                            <td><nested:write  property="partNumber"/></td>
                            <td><nested:write  property="lotNumber"/></td>
                            <td><nested:write  property="fabLotNumber"/></td>
                            <td><nested:write  property="vendorName"/></td>
                            <td><nested:write  property="psType"/></td>
                            <td><nested:write  property="dateIn"/></td>
                            <td><nested:write  property="currentQty"/></td>
                        </tr>
                    </nested:iterate>
                        <tr><td class="NArialL" colspan=4><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
                        <tr><td colspan=8 align="center">
                            <chiptrack:restrictedLink href="javascript:saveDataEntryLots()" functionality='<%=Functionality.DATA_ENTRY_LOTS %>' action='<%=User.USER_ACTION_MODIFY%>' styleClass="leftsection" onmouseover="window.status='Click here to Close selected DataEntry Lots';return true" onmouseout="window.status='';return true">
                            <img src="<%=chipTracContext%>/jsp/includes/images/save.gif" border="0" width="53" height="17" title="Click here to Close selected DataEntry Lots">
                            </chiptrack:restrictedLink>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:document.dataEntryLotsForm.reset();">
                            <img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17">
                            </a>
                            </td>
                        </tr>
                </logic:notEqual>
                    </table>
                </td>
            </tr>
        </logic:equal>
        </table>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</html:form>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</HTML>
